//package com.social.controller;
//
//import cn.hutool.json.JSONUtil;
//import com.social.pojo.Activity;
//import com.social.service.ActivityService;
//import lombok.extern.slf4j.Slf4j;
//import org.jasypt.encryption.StringEncryptor;
//import org.springframework.amqp.core.AmqpTemplate;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//
//import static com.social.constant.RabbitMqConstants.EXCHANGE_TOPIC_ES;
//import static com.social.constant.RabbitMqConstants.ROUTING_ES_ITEM;
//
///**
// * @author zero
// * @version 1.0
// * @project demo
// * @description 测试加密
// * @date 2022/12/31 09:46:19
// */
//@RestController
//@Slf4j
//public class TestController {
//    @Autowired
//    StringEncryptor encryptor;
//    @Resource
//   AmqpTemplate amqpTemplate;
//    @Resource
//    RabbitTemplate rabbitTemplate;
//    @Resource
//    ActivityService activityService;
//
//    @GetMapping("/test")
//     public void contextLoads() {
//
//        String dbUrl = encryptor.encrypt("jdbc:mysql://124.222.182.24:3306/social?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true");
//
//        System.out.println(dbUrl);
//
//        String username = encryptor.encrypt("root");
//
//        System.out.println(username);
//
//        String password = encryptor.encrypt("root");
//
//        System.out.println(password);
//
//        System.out.println("redis:");
//
//        String redisAd = encryptor.encrypt("43.139.18.108");
//        System.out.println(redisAd);
//        String redispwd = encryptor.encrypt("123321");
//        System.out.println(redispwd);
//
//        System.out.println("rabbitmq:");
//        String rbqUser = encryptor.encrypt("admin");
//        String rbqPwd = encryptor.encrypt("root");
//        System.out.println(rbqUser);
//        System.out.println(rbqPwd);
//
//        System.out.println("minio:");
//        String endpoint = encryptor.encrypt("http://1.14.120.65:9001");
//        String minUser = encryptor.encrypt("myminioadmin");
//        System.out.println(endpoint);
//        System.out.println(minUser);
//
//    }
//
//    @GetMapping("/test01")
//    public void test01(){
//       Activity activity = activityService.getById(5);
//        try{
//           rabbitTemplate.convertAndSend(EXCHANGE_TOPIC_ES,ROUTING_ES_ITEM,activity);
//       } catch (Exception e) {
//           log.error("发送MQ 有误， 参数为：" + activity.toString() + "异常：{}", e);
//       }
//    }
//}
